package com.exam.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.exam.entity.Answer;
import com.exam.vo.AnswerVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface AnswerMapper {

    @Insert("insert into answer(id,answerList,answerBelong,answerTime,isVaild, group_id,questionnaire_id) " +
            "values(#{id},#{answerList},#{answerBelong} , #{answerTime}, #{isVaild}, #{groupId},#{questionnaireId})")
    int addAnswerByForm(Answer answer);

    @Select("select id, answerList from answer where answerBelong = #{answerBelong} and questionnaire_id = #{questionnaireId}")
    List<Answer> findAnswerByBelongQu(Answer answer);
}
